package mm.chenchen.modules.job.task;

import mm.chenchen.modules.sys.service.impl.MysqlBackupServiceImp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component("mysqlBackupTask")
public class MysqlBackupTask implements ITask {

    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private MysqlBackupServiceImp serviceImp;

    @Value("${backup.mysql}")
    private String mySqlBackupPath;

    @Override
    public void run(String params) {
        logger.debug("mysqlBackupTask定时任务开始执行，参数为：{}", params);
        serviceImp.export(mySqlBackupPath);
    }
}
